# $Id$
# Maintainer: Dave Reisner <dreisner@archlinux.org>

pkgname=pkgfile
pkgver=17
pkgrel=1
pkgdesc="a pacman .files metadata explorer"
arch=('i686' 'x86_64')
url="http://github.com/falconindy/pkgfile"
license=('MIT')
depends=('libarchive' 'curl' 'pcre' 'pacman')
source=("https://pkgbuild.com/~dreisner/sources/$pkgname/$pkgname-$pkgver.tar.xz"{,.sig})
install=pkgfile.install
validpgpkeys=('487EACC08557AD082088DABA1EB2638FF56C0C53')  # Dave Reisner
md5sums=('c0ced1f0972891b41c9d84abcbf6bc1f'
         'SKIP')

build() {
  cd "$pkgname-$pkgver"

  ./configure \
    --with-systemdsystemunitdir=/usr/lib/systemd/system
  make

  # generate a license file
  sed '/\*\//q' src/pkgfile.c >LICENSE
}

package() {
  cd "$pkgname-$pkgver"

  make DESTDIR="$pkgdir" install
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

# vim: ft=sh syn=sh
